package com.yorick.authority.modal.request.department;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.yorick.common.util.TrimmerDeserializer;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import java.util.List;

@Getter
@Setter
public class DepartmentEditRequest {
    @JsonProperty("did")
    @NotNull
    private Integer did;
    @JsonProperty("dname")
    @NotNull
    @Length(message = "名称不能超过个 {max} 字符", max = 10)
    @JsonDeserialize(using = TrimmerDeserializer.class)
    private String dname;
    @Length(message = "描述不能超过个 {max} 字符", max = 100)
    @JsonProperty("description")
    @JsonDeserialize(using = TrimmerDeserializer.class)
    private String description;
    @JsonProperty("enabled")
    @NotNull
    @Max(1)
    private int enabled;
}
